package com.zhuiyun.pm.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    TokenCheck tokenCheck;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(tokenCheck).addPathPatterns("/**").excludePathPatterns(
                "/sysUser/**",
                "/announcement/selectAnnouncementList",
                "/clientuser/queryByPhone",
                "/client/auction/getGoodsList",
                "/clientuser/userlogin",
                "/publish/publishSaveAdd",
                "/runningWater/findAll",
                "/runningWater/getpage",
                "/client/auction/getGoodsEarnestMoneyByUserId",
                "/BidRecordController/getCurrentPrice",
                "/BidRecordController/saveBidRecord",
                "/clientuser/sendloginByPhone",
                "/BidRecordController/getRecordOfBid",
                "/client/auction/getGoodsEarnestMoneyCount",
                "/clientuser/getLoginUser",
                "/announcement/getUserInfoByToken",
                "/clientuser/sendQQMail",
                "/clientuser/AppLogin",
                "/login/getVerify",
                "/client/**",
                "/login/checkVerify",
                "/clientuser/register",
                "/clientuser/**",
                "/client/auction/generateGoodsEarnestMoney",
                "/client/auction/updateEarnestMoneyStatus",
                "/client/auction/getGoodsListBySellerIdAndStatus",
                "/client/auction/getGoodsListNotPage",
                "/publish/publishId/**",
                "/table/selectCollect",
                "/client/auction/getGoodsByUserIdLimit6",
                "/publish/getSpecsByGoodId",
                "/clientInterest/clientFen",
                "/listBysellerId/listBysellerId",
                "BidRecordController/getButtonStatus",
                "BidRecordController/sendEmail",
                "BidRecordController/updateStatus",
                "BidRecordController/getGainer",
                "/client/auction/getGoodsListBySellerIdAndStatus",
                "/chatRecord/getUserChatRecord",
                "/client/register"
        );
    }
}
